#include<bits/stdc++.h>

using namespace std;
typedef long long ll;

const int maxn = 1e6 + 2000;
ll dp[maxn];//dp[i]=1 <=> i is prime number


int main() {
    for (int i = 0; i < maxn; i++)dp[i] = 1;//i is prime number

    dp[0] = dp[1] = 0;//0,1 are not primer
    //O(nloglogn)
    for (int i = 2; i <= maxn / i; i++) {
        if (dp[i] == 1) {
            for (int j = 2 * i; j < maxn; j += i) {// j%i=0&&j>i
                dp[j] = 0;
            }
        }
    }

    int a = 1, b = 1000000;
    int tot = 0;
    for (int i = a; i <= b; ++i) {
        if (dp[i])++tot;
    }
    cout << tot;


}
